﻿using UnityEngine;
using System.Collections;

public class EyelidController : MonoBehaviour {

	public GameObject leftUpper;
	public GameObject leftLower;
	public GameObject rightUpper;
	public GameObject rightLower;
	public float upperLidDistance;
	public float lowerLidDistance;
	public float blinkTimeIn;
	public float blinkTimeOut;
	public float blinkInterval;
	public float blinkIntervalMin;
	public float blinkIntervalMax;
	public float blinkStartTime;
	public bool blinkingInProgress = false;

	// Use this for initialization
	void Start () {
		blinkInterval = Random.Range(blinkIntervalMin, blinkIntervalMax);
		blinkStartTime = Time.time;
	}
	
	// Update is called once per frame
	void Update () {
		if (!blinkingInProgress && (blinkStartTime + blinkInterval < Time.time))
		{
			blinkingInProgress = true;
		}
	}
}
